<div class="container-fluid">
  <span class='label label-info'>商品种类列表</span>
  <a class='label label-success pull-right' href='/category/list/'  style='margin-right:5px;'>全部</a>
  <a class='label label-success pull-right' href='/category/list_enable/'  style='margin-right:5px;'>已启用</a>
  <div id='category_list'>
    <table class='table table-bordered'>
      <thead>
      <tr>
        <th>#cid</th>
        <th>#name</th>
        <th>#status</th>
        <th style='width:50px;'>#op</th>
      </tr>
      </thead>
    <?php foreach ($categories as $c):?>
      <tr data-cid='<?php echo $c->cid;?>' data-name='<?php echo $c->name;?>' data-status='<?php echo $c->status;?>'>
        <td><?php echo $c->cid;?></td>
        <td><?php echo $c->name?></td>
        <td><?php echo $c->status;?></td>
        <td>
          <?php if (Category::where('cid', '=', $c->cid)->first()):?>
          <a class='btn btn-mini btn-danger disable'>禁用</a>
          <a class='btn btn-mini btn-success enable hide'>启用</a>
          <?php else:?>
          <a class='btn btn-mini btn-danger disable hide'>禁用</a>
          <a class='btn btn-mini btn-success enable'>启用</a>
          <?php endif;?>
        </td>
      </tr>
    <?php endforeach;?>
    </table>
  </div>
</div>
